- content_for :title, t('.title')
- categories = Category.with_projects.order(:name_pt).all
= render 'shared/header_big', overlayer: true

- if current_user
  #nearOfData data-state="#{current_user.address_state}"

.hero-search
  .w-container.u-marginbottom-10
    .w-row.w-hidden-main.w-hidden-medium
      .w-col.w-col-11
        .header-search
          .w-row
            .w-col.w-col-10.w-col-small-10.w-col-tiny-10
              .w-form
                = form_tag explore_path, method: 'GET', class: 'discover-form', id: 'search-form' do
                  = text_field_tag :pg_search, nil, autocomplete: "off", value: params[:pg_search], class: "w-input text-field negative prefix search-input", placeholder: t('layouts.header.search')

            .w-col.w-col-2.w-col-small-2.w-col-tiny-2
              = link_to '#', id: 'pg_search_submit', class: "w-inline-block btn btn-dark btn-attached postfix" do
                = image_tag "catarse_bootstrap/lupa.png", class: "header-lupa"
      .w-col.w-col-1

  .w-container.u-marginbottom-10
    .u-text-center.u-marginbottom-40
      a.explore-toggle.fontsize-larger.link-hidden-white.fontweight-light href="#"
        = t(".header_html")
        span.fa.fa-angle-down
    #categories-wrapper.w-hidden
      .w-row
        - unless categories.empty?
          - categories.each_with_index do |category, index|
            - if index % 6 == 0
              .w-row
            .w-col.w-col-2.w-col-small-6.w-col-tiny-6
              a.explore-link.w-inline-block.btn-category [
                class="#{'double-line' if category.to_s.size > 13}"
                href="#by_category_id/#{category.id}"
                data-name=category.display_name
                data-categoryid=category.id
                data-isfollowing=(current_user.try(:following_this_category?, category.id) ? 'true' : 'false')
                data-followpath=subscribe_category_path(category)
                data-unfollowpath=unsubscribe_category_path(category)
                data-totalfollowers=category.users.count
              ]
                = category.display_name
                span.badge.explore
                  = category.total_online_projects
      .w-row.u-marginbottom-30
        .w-col.w-col-2.w-col-small-6.w-col-tiny-6
          a.w-inline-block.btn-category.filters.explore-link[
            class="#{'double-line' if t('.recommended').size > 13}"
            href='#recommended'            
            data-name="#{t('.recommended')}"
          ]
            = t('.recommended')
            /span.badge.explore 35
        .w-col.w-col-2.w-col-small-6.w-col-tiny-6
          a.w-inline-block.btn-category.filters.explore-link[
            class="#{'double-line' if t('.in_funding').size > 13}"
            href='#in_funding'
            data-name="#{t('.in_funding')}"
          ]
            = t('.in_funding')

        .w-col.w-col-2.w-col-small-6.w-col-tiny-6
          a.w-inline-block.btn-category.filters.explore-link[
            class="#{'double-line' if t('.expiring').size > 13}"
            href='#expiring'
            data-name="#{t('.expiring')}"            
          ]
            = t('.expiring')

        .w-col.w-col-2.w-col-small-6.w-col-tiny-6
          a.w-inline-block.btn-category.filters.explore-link[
            class="#{'double-line' if t('.recent').size > 13}"
            href='#recent'
            data-name="#{t('.recent')}"
          ]
            = t('.recent')

        .w-col.w-col-2.w-col-small-6.w-col-tiny-6
          a.w-inline-block.btn-category.filters.explore-link[
            class="#{'double-line' if t('.successful').size > 13}"
            href='#successful'
            data-name="#{t('.successful')}"
          ]
            = t('.successful')
        - if current_user
          .w-col.w-col-2.w-col-small-6.w-col-tiny-6
            a.w-inline-block.btn-category.filters.explore-link[href="#near_of/#{current_user.address_state}" data-name="#{t('.near')}"]
                = t('.near')

section.w-container.u-marginbottom-10
    .w-row.u-margintop-10.u-marginbottom-40
      #explore_results[data-projects-path=projects_path]
        .w-row
          .follow-category.w-hidden
            .w-col.w-col-6.w-col-small-7.w-col-tiny-7
              .category-info.fontsize-larger
                | Category-name
            .w-col.w-col-6.w-col-small-5.w-col-tiny-5
              .category-follow
                .w-row
                  .w-col.w-col-8.w-hidden-small.w-hidden-tiny.w-clearfix
                    .following.fontsize-small.fontcolor-secondary.u-right
                      span.count
                        | 0
                      '  #{t('.following')}
                  .w-col.w-col-4.w-col-small-12.w-col-tiny-12
                    a href="javascript:(void);" class='btn btn-medium follow-btn'
                      = t('.follow')
                    a href="javascript:(void);" class='btn btn-medium btn-terciary unfollow-btn'
                      = t('.unfollow')

          .clearfix
        .w-row.u-margintop-30
          .results &nbsp;
          .clearfix
          #loading.loader.u-text-center.w-col.w-col-12 = image_tag "catarse_bootstrap/loader.gif"

section.section.loadmore
  .w-container
    .w-row
      .w-col.w-col-push-5.w-col-2
        button id="load-more" class="btn btn-medium btn-terciary hidden"
          = t('shared.load_more')


= render 'shared/footer_big'
